package com.github.xtranslation.core.repository;


import cn.hutool.core.collection.ListUtil;
import com.github.xtranslation.core.dto.SubjectDO;

import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class SubjectTransRepository implements TransRepository {

    @Override
    public Map<Object, Object> getTransValueMap(List<Object> transIdList, Annotation transAnno) {
        // 模拟数据库查询到的数据
        return ListUtil.of(
                        new SubjectDO(1L, "科目1"),
                        new SubjectDO(2L, "科目2"),
                        new SubjectDO(3L, "科目3"),
                        new SubjectDO(4L, "科目4"))
                .stream().filter(x -> transIdList.contains(x.getId())).collect(Collectors.toMap(SubjectDO::getId, x -> x));
    }


}
